-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ project(cmkr | |
LANGUAGES | ||
CXX | ||
VERSION | ||
0.1.3 | ||
0.1.4 | ||
DESCRIPTION | ||
"CMakeLists generator from TOML" | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,44 @@ | ||
# This file was generated automatically by cmkr. | ||
|
||
# Regenerate CMakeLists.txt file when necessary | ||
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT) | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
if(CMKR_INCLUDE_RESULT) | ||
cmkr() | ||
endif() | ||
# Regenerate CMakeLists.txt automatically in the root project | ||
set(CMKR_ROOT_PROJECT OFF) | ||
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) | ||
set(CMKR_ROOT_PROJECT ON) | ||
|
||
cmake_minimum_required(VERSION 3.15) | ||
# Bootstrap cmkr | ||
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT) | ||
if(CMKR_INCLUDE_RESULT) | ||
cmkr() | ||
endif() | ||
|
||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
# Enable folder support | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
endif() | ||
|
||
set(example_PROJECT_VERSION 0.1.0) | ||
project(example VERSION ${example_PROJECT_VERSION}) | ||
# Create a configure-time dependency on cmake.toml to improve IDE support | ||
if(CMKR_ROOT_PROJECT) | ||
configure_file(cmake.toml cmake.toml COPYONLY) | ||
endif() | ||
|
||
set(EXAMPLE_SOURCES | ||
src/example.cpp | ||
cmake.toml | ||
project(example | ||
VERSION | ||
0.1.0 | ||
) | ||
|
||
add_executable(example ${EXAMPLE_SOURCES}) | ||
# Target example | ||
set(example_SOURCES | ||
"src/example.cpp" | ||
cmake.toml | ||
) | ||
|
||
source_group(TREE ${PROJECT_SOURCE_DIR} FILES ${EXAMPLE_SOURCES}) | ||
add_executable(example ${example_SOURCES}) | ||
|
||
get_directory_property(CMKR_VS_STARTUP_PROJECT DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION VS_STARTUP_PROJECT) | ||
if(NOT CMKR_VS_STARTUP_PROJECT) | ||
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT example) | ||
endif() | ||
|
||
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${example_SOURCES}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
# This is a minimal example project used for testing the cmkr bootstrapping process | ||
|
||
[cmake] | ||
minimum = "3.15" | ||
version = "3.15" | ||
|
||
[project] | ||
name = "example" | ||
version = "0.1.0" | ||
|
||
[[target]] | ||
name = "example" | ||
[target.example] | ||
type = "executable" | ||
sources = ["src/example.cpp"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters